from render.lua_render import single_render, multi_render, const_render
from reader.excel_reader import ExcelDataParser, ExcelIndexParse

def _test_render():
    print("single_render")
    data = {'name': 'Tom', 'age': 20}
    lua_code = single_render("data", data)
    print(lua_code)

    print("multi_render")

    data = {}
    data["data"] = {'name': 'Tom', 'age': 20}
    data["order"] = {'name': 'Jerry', 'age': 30}
    lua_code = multi_render("data_list", data)
    print(lua_code)

    print("const_render")
    data = {}
    data["name"] = {"value": "Tom", "note": "name"}
    data["age"] = {"value": 20, "note": "age"}
    lua_code = const_render("data_const", data)
    print(lua_code)

def _test_index_reader():
    index_reader = ExcelIndexParse('excel/CurrencyBase3.xlsx')
    sheet_info_dict = index_reader.parse()
    for sheet_name, sheet_info in sheet_info_dict.items():
        data_parse = ExcelDataParser('excel/CurrencyBase3.xlsx')
        data_parse.parse(sheet_name, sheet_info["export"])


    print(sheet_info)



if __name__ == "__main__":
    pass
